#ifndef __CORE_QUATERNIONS__
#define __CORE_QUATERNIONS__
namespace Core
{
	class rtVector3;
	class rtAngles;
	class rtRotation;
	class rtMatrix3;
	class rtMatrix4;

	class rtQuaternions
	{
	public:
		float			x;
		float			y;
		float			z;
		float			w;

		rtQuaternions(void);
		rtQuaternions(float x, float y, float z, float w);

		void 			    set(float x, float y, float z, float w);

		float			    operator [] (int index) const;
		float&			    operator [] (int index);
		rtQuaternions		operator - () const;
		rtQuaternions&		operator = (const rtQuaternions& a);
		rtQuaternions		operator + (const rtQuaternions& a) const;
		rtQuaternions&		operator += (const rtQuaternions& a);
		rtQuaternions		operator - (const rtQuaternions& a) const;
		rtQuaternions&		operator -= (const rtQuaternions& a);
		rtQuaternions		operator * (const rtQuaternions& a) const;
		rtVector3			operator * (const rtVector3& a) const;
		rtQuaternions		operator * (float a) const;
		rtQuaternions&		operator *= (const rtQuaternions& a);
		rtQuaternions&		operator *= (float a);

		friend rtQuaternions	operator*(const float a, const rtQuaternions& b);
		friend rtVector3	operator*(const rtVector3& a, const rtQuaternions& b);

		bool			compare(const rtQuaternions& a) const;
		bool			compare(const rtQuaternions& a, const float epsilon) const;
		bool			operator==(	const rtQuaternions& a) const;
		bool			operator!=(	const rtQuaternions& a) const;

		rtQuaternions	inverse(void) const;
		float			length(void) const;
		rtQuaternions&	normalize(void);

		float			calcW(void) const;
		int				getDimension(void) const;

		rtAngles		toAngles(void) const;
		rtRotation		toRotation(void) const;
		rtMatrix3		toMat3(void) const;
		rtMatrix4		toMat4(void) const;
		rtVector3		toAngularVelocity(void) const;
		const float*	toFloatPtr(void) const;
		float*		    toFloatPtr(void);

		rtQuaternions&	slerp(const rtQuaternions& from, const rtQuaternions& to, float t);
	};


}
#endif


